<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>创建和使用对象方法</p>
    <p>对象方法作为一个函数定义存储在对象属性中。</p>
    <p id="demo" style="color: red;"></p>
    <script>
        var person={
            firstName:"shuangshuang",
            lastName:"yang",
            id:6666,
            fullName:function(){    //创建对象语法
                return this.firstName+"  "+this.lastName;
            }
        }
        document.getElementById("demo").innerHTML=person.fullName();    //访问对象语法
    </script>   

    <script>
        var text="shuangshuang";
        console.log("text.length is:"+text.length);
       document.write( "text.length:"+ text.length + "<br />");
    </script>

<script>
    id:
        for(i = 0; i<20;i++){
            // if(i==15){
            //     break id;
            // }
            document.write("i: " + i + "    ")
        }
</script>
</body>
</html>